<template>
    <div>

        <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" />
        <!-- {{qsearch  }} -->
        <van-cell-group v-for="item in qsearch">
            <van-cell  :title="item.goods_name"/>

        </van-cell-group>


    </div>
</template>

<script setup>
import { qsearchApi } from '@/api/api'
import { ref, watch } from 'vue';
let value = ref('')
let qsearch = ref([])
watch(value, (val) => {
    qsearchApi(val).then(res => {
        console.log('搜索', res)
        qsearch.value = res.data.message
        console.log(qsearch)

    })

})

</script>

<style lang="scss" scoped></style>